/* ========================================================================= */
/* ------------------------------------------------------------------------- */
/*!				\file		CC_Graphic.h
				\date		june 2010
				\author		TNick

				\brief		Contains the definition of CC_Graphic class and related


    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Please read ReadMe.txt and Licence.txt in root folder
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    
*/
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
#ifndef		__CC_GRAPHIC_INC__
#define		__CC_GRAPHIC_INC__
#ifdef		__cplusplus
//
//
//
//
/*  INCLUDES    ------------------------------------------------------------ */

class CC_Layer;
class CC_DrawSpace;

#include	"CC_Err.h"
#include	"CC_GraphItemProp.h"
#include	"CC_Item.h"

/*  INCLUDES    ============================================================ */
//
//
//
//


/// Class representing a graphical item
/**
*
*/
class	CC_Graphic	: public CC_Item {


	//
	//
	//
	//
	/*  DEFINITIONS    --------------------------------------------------------- */

	
	/*  DEFINITIONS    ========================================================= */
	//
	//
	//
	//
	/*  DATA    ---------------------------------------------------------------- */

	/// graphical data
	CC_GIP*		grd;

	/// pointer to the layer where this item belongs
	CC_Layer*	pLay;

	/// pointer to the space where is hosted
	CC_DrawSpace*	pSpc;

	/*  DATA    ================================================================ */
	//
	//
	//
	//
	/*  FUNCTIONS    ----------------------------------------------------------- */

	/// constructor; must enshure that only one instance is present
public: CC_Graphic();

	/// destructor; will free resources; not virtual;
public: virtual ~CC_Graphic();



	/// tell if this item is a graphical one or not
public: virtual bool		IsGraphical() {return TRUE; };



	/// saves the data regarding this class to a stream in CASP_1 format
	/*
*	@return		true all went OK; false some went wrong
*/
public: virtual CCERR::EERRORS		Save_CASP_1	(QDataStream* pStream, CC_Err* pErr);

	/// loads the data regarding this class from a stream in CASP_1 format
	/*
*	@return		true all went OK; false some went wrong
*/
public: virtual CCERR::EERRORS		Load_CASP_1	(QDataStream* pStream, CC_Err* pErr);




	/// saves the data regarding this class to a stream in DXF format
	/*
*	@return		true all went OK; false some went wrong
*/
public: virtual CCERR::EERRORS		Save_DXF	(QDataStream* pStream, CC_Err* pErr);

	/// loads the data regarding this class from a stream in DXF format
	/*
*	@return		true all went OK; false some went wrong
*/
public: virtual CCERR::EERRORS		Load_DXF	(QDataStream* pStream, CC_Err* pErr) ;




	/// tell the layer of this item
public: inline CC_Layer*		Layer		(void)
		{ return pLay; };
	/// set the layer of this item
public: inline CCERR::EERRORS	setLayer	(CC_Layer* pNewLy, CC_Err* pErr)
		{ Q_UNUSED(pErr); pLay = pNewLy; return CCERR::ERR_SUCCESS; };


	/// tell in what space (if any) is this item present
public: inline CC_DrawSpace*	Space		(void)
		{ return pSpc; };
	/// set the spacer for this item
public: inline CCERR::EERRORS	setSpace	(CC_DrawSpace* pNewSpc, CC_Err* pErr)
		{ Q_UNUSED(pErr); pSpc = pNewSpc; return CCERR::ERR_SUCCESS; };



	/*  FUNCTIONS    =========================================================== */
	//
	//
	//
	//

};	/*	class	CC_Graphic	*/
//
//
//
//
#endif	//	__cplusplus
#endif	//	__CC_GRAPHIC_INC__
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
